package controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.Products;

public class DeleteProduct extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		PrintWriter out = response.getWriter();
		String proId = request.getParameter("id");
		Products ProductDTO = new Products();
		try {
			ProductDTO.DeleteProduct(proId);
			out.println("Xóa thàng công!");
		} catch (Exception e) {
			out.println("<font color=\"#ff0000\">Xóa thất bại, vui lòng thử lại!</font>");
		}
	}
}
